<%--
  Created by IntelliJ IDEA.
  User: 12700
  Date: 2025/9/4
  Time: 22:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员中心</title>
    <link rel="stylesheet" href="../../css/usersadmin.css">
    <script type="text/javascript" src="../../js/jquery-1.8.3.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var username = localStorage.getItem('savedUsername');
            $("<img src='../../images/touxiang.png'><p>"+username+"</p>").appendTo(".admincontroller");
            $.get("../../admin/showusers",{"id":'null',"indexpage":+1},function (ph) {
                showdt(ph);
            });

            $(document).on("click","input[name]",function () {
                var indexpage=$(this).attr("name");
                $.get("admin/showusers",{"id":'null',"indexpage":indexpage},function (ph) {
                    showdt(ph);
                });
            });
            $("[value='退出登录']").click(function () {
                window.location.href="../../index.jsp";
            });
        });

        function showdt(ph) {
            JSON.stringify(ph);
            $(".tbody").empty();
            for(i=0;i<ph.listIndex.length;i++){
                $("<div>"+
                    "                        <div><p>"+ph.listIndex[i].username+"</p></div>\n" +
                    "                        <div><p>"+ph.listIndex[i].password+"</p></div>\n" +
                    "                        <div><p>"+ph.listIndex[i].role+"</p></div>\n" +
                    "                        <div><p>"+ph.listIndex[i].created_at+"</p></div>\n" +
                    "                        <div><p>"+ph.listIndex[i].updated_at+"</p></div>\n" +
                    "<div><a href='auserupdate.jsp?username=" + ph.listIndex[i].username + "'>修改操作</a></div>" +
                    "<div><a href='ausersdel.jsp?username=" + ph.listIndex[i].username + "'>删除操作</a></div>" +
                    "</div>").appendTo(".tbody");
            };

            $(".tfoot").empty();
            if (ph.pageIndex!=1){
                $("<input type='button' value='首页' name='1'>").appendTo(".tfoot");
                $("<input type='button' value='上一页' name='"+(ph.pageIndex-1)+"'>").appendTo(".tfoot");
            }
            $("<b>第"+ph.pageIndex+"页/共"+ph.pageCount+"页</b>").appendTo(".tfoot");
            if(ph.pageIndex!=ph.pageCount){
                $("<input type='button' value='下一页' name='"+(ph.pageIndex+1)+"'>").appendTo(".tfoot");
                $("<input type='button' value='尾页' name='"+ph.pageCount+"'>").appendTo(".tfoot");
            };

        };
    </script>
</head>
<body>
<div class="head">
    <div class="icon"><img src="../../images/logo.png"></div>
    <div class="admin">
        <div class="admincontroller"></div>
        <div class="adminshow">
            <div><b>个人中心</b></div>
            <div><b>更多通知</b></div>
            <div><input type="button" value="退出登录"></div>
        </div>
    </div>
</div>
<div class="body">
    <div class="body-left">
        <img src="../../images/adv.jpg">
    </div>
    <div class="body-right">
        <div class="label">
            <div class="label-bar">
                <a href="usersadmin.jsp"><div class="selected">用户管理</div></a>
                <a href="couriersadmin.jsp"><div class="unselected">物流员管理</div></a>
                <a href="Admins.jsp"><div class="unselected">包裹查询</div></a>
            </div>
            <div class="label-top">
                <br>
                <div class="top-head"><b>包裹查询</b></div>
            </div>
            <div class="label-bottom">
                <div class="bottom-head">
                    <div><p>用户名</p></div>
                    <div><p>密码</p></div>
                    <div><p>角色</p></div>
                    <div><p>创建时间</p></div>
                    <div><p>修改时间</p></div>
                    <div><p>修改操作</p></div>
                    <div><p>删除操作</p></div>
                </div>
                <div class="tbody">

                </div>
                <div class="tfoot">
                    <tfoot>

                    </tfoot>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="foot"></div>
</body>
</html>
